<script>
// 顶部tab+页面切换
import { defineComponent } from 'vue'
export default defineComponent({
	name: 'WeworkQr'
})
</script>
<script setup>
import { ref } from 'vue'
import { toRaw } from '@vue/reactivity'
import Chat from './chat.vue'
const dialogVisible = ref(false)
const moduleName = ref('group')
const editQr = ref(null)
const showEdit = (val) => {
	if (val) {
		editQr.value.show(toRaw(val).id)
	} else {
		editQr.value.show()
	}
	dialogVisible.value = true
}
</script>
<template>
	<div>
		<div>
			<div class="app-tab app-tab-margin-top">
				<div @click="moduleName = 'group'" :class="moduleName == 'group' ? 'app-tab-item-active' : 'app-tab-item'">群聊检索</div>
				<div @click="moduleName = 'customer'" :class="moduleName == 'customer' ? 'app-tab-item-active' : 'app-tab-item'">客户检索</div>
        	<div @click="moduleName = 'staff'" :class="moduleName == 'staff' ? 'app-tab-item-active' : 'app-tab-item'">员工检索</div>
			</div>
			<Chat v-if="moduleName == 'group'" type='group' @showEditQr="showEdit" />
      <Chat v-if="moduleName == 'customer'" type='customer'  @showEditQr="showEdit" />
      <Chat v-if="moduleName == 'staff'" type='staff'  @showEditQr="showEdit" />
		</div>
	</div>
</template>
<style lang="scss">
@import url('../../../style/app-component.scss');
@import '../../../style/mixin.scss';
</style>
